package chai.ning.recursion;

import java.io.PrintStream;

public class Snake {
	private String name = "赖皮蛇";

	public long factorial(long n) {
		if (n < 0L) {
			System.out.println(this.name + "友情提示您，负数没有阶乘");
			return -250L;
		}
		if ((n == 0L) || (n == 1L)) {
			return 1L;
		}

		return n * factorial(n - 1L);
	}

	public static void main(String[] args) {
		Snake s = new Snake();
		long n = 10L;
		long r = s.factorial(n);
		System.out.println(n + "! = " + r);
		s.factorial(-6L);
	}
}
